As communications technologies continuously develop, information security attracts ever-increasing attention. Some important data usually needs to be encrypted before being stored in a memory. At present, an Advanced Encryption Standard (AES) algorithm is usually used to encrypt data that is to be stored in a memory.
In other approaches, when a transmit end needs to transmit data to a memory, an encryption apparatus uses the AES algorithm to encrypt the data sent by the transmit end, and saves encrypted data in the memory, that is, the memory saves data encrypted using the AES algorithm. In addition, physical addresses of the data are arranged in sequence. An attacker can perform a targeted attack on data using a corresponding physical address, or an attacker can obtain data stored in the memory by performing fault injection on the data stored in the memory. Therefore, a poor security problem still exists even though an encryption algorithm is used to encrypt data before storage.